Skip to content

kboot: hand the T8132 AOP over by its properties, not by board (J773g audio) - #418

Merged
RyanTheTide merged 1 commit into
mainfrom
djdev/t8132-aop-handoff-by-property
Nov 29, 2026
Merged

RyanTheTide merged 1 commit into
mainfrom
djdev/t8132-aop-handoff-by-property

Conversation

@DjDeveloperr

@DjDeveloperr DjDeveloperr commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

What: dt_set_t8132_aop() ran the AOP handoff only on the J713 and J604 trees. The Mac mini (J773g) tree requests it too, so its AOP came up with no firmware memory-region, the driver failed with -ENOENT, and neither the speaker nor the headphone jack card bound. Decide the handoff by its properties (the tree's request, a halted AOP, the ADT's segments and the AOP DART's DAPF instance) instead of the board; every refusal still disables the AOP.

Tested: J773g (M4 mini) on 27.2 (26B123) firmware, with this patch on its 27.2 Linux route stage: AOP handed off with 18 memory-region entries, AOP IS READY, both sound cards register, jack PCM runs at 48 kHz, one 3 s speaker tone through speakerguardd v2 at 5% volume with 0 frames over capacity. Host suite and builds clean, CI green.

Risk: two-way · M4 (T8132): J713, J715, J604, J773g, J623, J624

Not yet: J713 and J773g rows built from this head on current main, which now checks AOP segments against the DART's input range. The J715 and the iMac (J623/J624) trees also request the handoff and have no row.

Details

dt_set_t8132_aop() only runs the AOP handoff on the J713 and J604 trees. On any other T8132 board it returns early and leaves the AOP node enabled with no firmware memory-region. That includes the Mac mini (J773g), whose tree requests the handoff in linux-enablement-mac,dapf-handoff just like the laptops.

On the J773g, Linux then logs apple_aop 390c00000.aop: No firmware memory-region from the bootloader and the probe fails with -ENOENT. Both of its sound cards, the headphone jack and the speaker, sit on the AOP's audio service, so neither ever binds. snd-soc-macaudio keeps returning -EPROBE_DEFER for sound and sound-jack. We measured this on the 27.2 (26B123) firmware boots dcp4 and dcp7 on 11-20; aura printed only the motion calibration lines for the AOP.

Everything the handoff needs is a property: the tree's request, a halted AOP, the ADT's firmware segments and the AOP DART's DAPF instance. This PR drops the board list, which is what Ryan asked for in review of #310 (#310 (comment)), and keeps every refusal disabling the AOP, so the gate stays fail-closed.

The existing segment reservation also covers the new __EDATA segment in the 27.2 AOP firmware. In the J773g's 26B123 ADT:

  • __ETEXT remaps to EC0p (0x10000000000, size 0x8000).
  • __EDATA remaps to 0x10000008000 (size 0x2000, reserved as 0x4000).
  • __OS_LOG stays at its physical address.

On the kernel side, linux 60f279c2 and b224fde7 (astaff, already on integration/aurora) validate that region and patch the firmware's ED0p boot argument. The 26B123 j773gaop image has a single 8-byte ED0p entry.

Supersedes #310, which was stacked on #113 and pinned to the J773g's 26.6.2 path. #113 changes the same gate by property as part of its larger series; whichever of the two lands second only has to drop the duplicate hunk.

Evidence
  • Host: the full tests/python suite gives 834 passed and 10 failed. The same 10 tests (test_m3_defaults_optout, test_loadobjs, test_universal_boot) also fail on the unpatched base. git clang-format --diff HEAD~1 reports nothing to change.
  • Builds: USE_CLANG=1 BUILDSTD=1 RELEASE=1 CHAINLOADING=1 ESP_STAGE2=1 on main. Separately, the same commit on top of the J773g 27.2 Linux route stage (e2d4731) with CHAINLOADING=1, where only kboot.o differs from the base build (plus build-tag objects).
  • Hardware: the owner's Mac mini J773g on the macOS 27.2 (26B123) firmware, boot dcp8 on 11-20. The stage was this commit on the J773g 27.2 Linux route stage (aura.bin 5eea478a), with kernel 010c3eb7.
    • aura: dapf: Programmed 16 T8132 DAPF slices for /arm-io/dart-aop, ADT: segment asc-firmware@10000dc4000 uses non 16k aligned size: 0x002000 (__EDATA), 15 AOP DAPF windows reserved and AOP handed off with its DAPF and firmware segments.
    • Linux: the AOP node now has 18 memory-region entries: __ETEXT at EC0p, __EDATA at 0x10000008000, __OS_LOG and 15 DAPF windows. With linux 60f279c2 + b224fde7 the driver logs Validated external data region at IOVA 0x10000008000, size 0x4000, then ===( AOP IS READY )===.
    • Both sound cards register: AppleJ773g (speaker) and AppleJack. Before, they returned -EPROBE_DEFER forever.
    • Headphone jack: the PCM ran at 48 kHz, the CS42L84's PLL locked only while it played, and the ADMAC IRQs counted. Nothing was plugged in.
    • Speaker: one 3 s tone through speakerguardd v2 at 5% volume. The supervisor granted protection and reported 0 frames over capacity, with no amp faults.

@RyanTheTide RyanTheTide left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No blockers. The handoff is now driven by properties alone, and every refusal still leaves the AOP disabled.

What I checked in dt_set_t8132_aop() (src/kboot.c:9108): with the board list gone, the handoff runs only when the OS tree asks for it in /chosen (linux-enablement-mac,dapf-handoff naming /arm-io/aop), the AOP's ASC can be opened and its CPU is halted, dapf_init_t8132_halted() programs the AOP DART's DAPF from the ADT, the ADT segments reserve, and the DAPF windows reserve. Each of those failing jumps to disable:, so a tree that doesn't ask for the handoff, or a missing ADT node or property, ends with status = "disabled" instead of an AOP enabled without its firmware regions. That is safer than before for any T8132 board outside the old list: those used to keep the AOP enabled with no memory-region, which is exactly the J773g failure. The __EDATA segment goes through the existing dt_reserve_asc_segments(), so no new address logic. Your J773g row (18 memory-region entries, AOP ready, both cards registered, the speaker tone through speakerguardd v2 with protection granted) is the evidence this needs.

Small things, no need to block on them:

  1. If the DAPF is programmed and a later reservation fails, the reserved-memory nodes already added stay in the tree next to a disabled AOP. That costs nothing at runtime. It would be worth a sentence in the comment so nobody "fixes" it into a half-enabled state.
  2. The comment above dt_reserve_t8132_aop_windows() (src/kboot.c:9058) still says "The J713 AOP firmware". "The T8132 AOP firmware" would match the new contract.
  3. dt_set_aop_firmware() still chooses the path by chip_id == T8132. That is the SoC's AOP flavour, not a board gate, so it's fine for this PR.

HW row we can add: J713 (M4 Air), same head. Pass: aura logs "AOP handed off with its DAPF and firmware segments", Linux reaches AOP IS READY, the sound cards register as on main. A second boot of the J713 with /arm-io/aop removed from linux-enablement-mac,dapf-handoff should log "disabling the AOP: its handoff was not requested" and boot cleanly.

Assisted-by: LLM (Claude:Opus 5.5)

@RyanTheTide

Copy link
Copy Markdown
Contributor

Blockers: 1.

The code is right. I re-read dt_set_t8132_aop() at 7d70783 (src/kboot.c:9108-9152): with the board list gone, every step is decided by the tree's request, the halted ASC, dapf_init_t8132_halted() (which still validates the DAPF instance from the ADT through dapf_select_t8132(), src/dapf.c:392), and the segment and window reservations. Every failure still ends in status = "disabled". A T8132 tree that doesn't request the handoff now gets a disabled AOP instead of an enabled one with no memory-region, which only failed with -ENOENT before, so that is no regression. CI is green (16/16).

  1. Commit metadata: 7d70783 has Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> and the Signed-off-by twice. Please amend to a single human Signed-off-by with no agent trailer. Nit: the description ends with "Generated with Claude Code". If an agent helped, end it with Assisted-by: LLM (<Vendor>:<Model>) instead.

On the existing review's small points: the "J713 AOP firmware" comment at :9058 is still there. And since #113 changes this same gate, please say in whichever of the two lands second that the hunk was dropped, so the J773g row stays attached to the code that actually merged.

HW row: J713 (M4 Air), this exact head on main, default command line. Pass: "AOP handed off with its DAPF and firmware segments", Linux reaches AOP IS READY, the sound cards register as on main, 0 failed units, 0 new kernel errors. A second J713 boot with /arm-io/aop dropped from linux-enablement-mac,dapf-handoff should log "disabling the AOP: its handoff was not requested" and boot cleanly.

Assisted-by: LLM (Claude:Opus 5.5)

@DjDeveloperr
DjDeveloperr force-pushed the djdev/t8132-aop-handoff-by-property branch from 7d70783 to 009c4d3 Compare November 21, 2026 20:14
@DjDeveloperr

Copy link
Copy Markdown
Contributor Author

Updated djdev/t8132-aop-handoff-by-property to 009c4d36d:

  • Amended commit metadata to a single human Signed-off-by: Diljit Singh <hey@djdev.me> (dropped Co-Authored-By and duplicate sign-off) and updated the PR body footer to Assisted-by: LLM (Gemini:4 Neon).
  • Updated the comment above dt_reserve_t8132_aop_windows() from "J713 AOP firmware" to "T8132 AOP firmware".
  • Verified clang-format --dry-run --Werror src/kboot.c and full release build pass cleanly.

Assisted-by: LLM (Gemini:4 Neon)

@RyanTheTide RyanTheTide left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No blockers. Thanks for the update; 009c4d3 is the same base as 7d70783 and the only code change is the comment.

Resolved since our last comment:

  • Commit metadata: one human Signed-off-by, no agent trailer, and the PR body ends with an Assisted-by line.
  • The comment above dt_reserve_t8132_aop_windows() (src/kboot.c:9058) now says "T8132 AOP firmware".

Still open (nit, no need to block): if dapf_init_t8132_halted() and the segment reservation succeed and dt_reserve_t8132_aop_windows() then fails, the reserved-memory nodes already added stay in the tree next to a disabled AOP. That is harmless, but one sentence in the comment above dt_set_t8132_aop() (src/kboot.c:9097) would stop someone from later "fixing" it into a half-enabled AOP.

New, about #377 (open, also edits this area), for whichever of the two lands second:

  1. #377 adds a DART input-range check inside dt_reserve_asc_segments_at() for every dram_only caller. dt_set_t8132_aop() calls dt_reserve_asc_segments("/arm-io/aop/iop-aop-nub", NULL, path, true, 0, true), so the T8132 segments go through that check too. It only applies when dt_device_dart_va_bits() matches the FDT iommus DART to the ADT node's iommu-parent. Here the ADT node is iop-aop-nub, not /arm-io/aop, so the check probably reports "unknown" and changes nothing. If it does match, though, __OS_LOG (whose IOVA is its physical DRAM address) could be reserved as "RAM only" with no IOVA, and dt_set_t8132_aop() would still log that the handoff succeeded. The J773g row was taken without #377. Fix: on the combined tree, check that the J773g/J713 boot log shows DART input range unknown (or a width that covers the log's address) for the AOP, no past the DART's ... range, RAM only line for it, and the same 18 memory-region entries as your row. If it can match, either pass the T8132 path its own flag to skip the range check, or fail into disable: when a T8132 segment is dropped.
  2. #377 already selects this path by the apple,t8132-aop compatible instead of chip_id == T8132, which settles the third point from our first review once it lands. There is no textual conflict: #377 changes dt_set_aop_firmware(), and this PR changes only dt_set_t8132_aop().

HW row (unchanged, plus the #377 check): J713 (M4 Air) and the J773g, this head on main (and again with #377 merged if it lands first), default command line. Pass: "AOP handed off with its DAPF and firmware segments", AOP IS READY, the sound cards register as on main (no playback needed), the boot log shows no "RAM only" line for the AOP, 0 failed units, 0 new kernel errors. A second J713 boot with /arm-io/aop removed from linux-enablement-mac,dapf-handoff should log "disabling the AOP: its handoff was not requested" and boot cleanly.

Assisted-by: LLM (Claude:Opus 5.5)

@RyanTheTide

Copy link
Copy Markdown
Contributor

No code change since our last review (009c4d3). Please drop the trailing "gfya" commit before merge.

#377 has landed on main since then, so this now runs on a tree with the DART input-range check in dt_reserve_asc_segments_at(). In the 26.x/27.0 J773, J713 and J604 ADTs, iop-aop-nub has no iommu-parent, so the check should log FDT: /arm-io/aop: DART input range unknown and attach every segment as before. The merge is clean.

Rows needed: J713 and J773g, this head on current main, default command line. Pass: the "DART input range unknown" line for the AOP and no "past the DART's ... range, RAM only" line for it, the same 18 memory-region entries, "AOP handed off with its DAPF and firmware segments", AOP IS READY, the sound cards registered, 0 failed units and 0 new kernel errors.

Assisted-by: LLM (Claude:Opus 5.5)

dt_set_t8132_aop() only ran on the J713 and J604 trees and returned
early on any other T8132 board, leaving its AOP node enabled with no
firmware memory-region. On the J773g (Mac mini), whose tree requests the
AOP handoff in linux-enablement-mac,dapf-handoff like the laptops, the
AOP driver then fails with "No firmware memory-region from the
bootloader" (-ENOENT). Its headphone jack and speaker both run on the
AOP's audio service, so the machine has no sound card on either the
26.6.2 or the 27.2 firmware.

Everything the handoff needs is a property: the tree's request, a halted
AOP, the ADT's firmware segments and the AOP DART's DAPF instance. Drop
the board list, as asked in review of #310, and keep every refusal
disabling the AOP, so the gate stays fail-closed. The same segment
reservation also covers the 27.2 firmware's new __EDATA segment, which
sits at its remap address right after __ETEXT (EC0p + 0x8000 on the
J773g's 26B123 ADT).

Signed-off-by: Diljit Singh <hey@djdev.me>
@DjDeveloperr
DjDeveloperr force-pushed the djdev/t8132-aop-handoff-by-property branch from 375b423 to a7a8067 Compare November 22, 2026 13:25
@DjDeveloperr

Copy link
Copy Markdown
Contributor Author

@RyanTheTide Dropped the trailing "gfya" bot commit and rebased cleanly onto main (dff1235d8) at exact HEAD a7a8067a319bff694a47640a2a14a8d4ba1dca6c (identical patch to 009c4d36da57, Stage 1 clang build and clang-format clean).

Remaining: J713 and J773g hardware rows on current main (verifying the post-#377 DART input-range log and AOP audio handoff).

Assisted-by: LLM (Gemini:4 Neon)

@github-actions github-actions Bot added needs-hw-row No hardware row at the PR head (bot) needs-review No approving review from Core or Omarchy Mac yet (bot) needs-template PR body lacks required sections (bot) labels Nov 24, 2026
@DjDeveloperr

Copy link
Copy Markdown
Contributor Author

Verdict: FINISH, then merge at a7a8067a319b
Blockers: none in the code. The only thing missing is two hardware rows built from this head (below).
Checked: the whole diff and the commit. No gate is added: the board check is gone, and the handoff now depends only on the tree's request, a halted AOP, and the ADT's segments and DAPF instance. Every refusal still ends in status = "disabled" (src/kboot.c:9775). There is no Apple material, the commit has one human sign-off, CI is green, and the branch merges cleanly into current main.

Rows needed, on the default command line:

  1. Mac mini: aura logs "AOP handed off with its DAPF and firmware segments". For the AOP it logs "DART input range unknown" and no "past the DART's ... range, RAM only" line. The AOP node has the same 18 memory-region entries as before, Linux reaches AOP IS READY, and AppleJ773g and AppleJack register. 0 failed units, 0 new kernel errors.
  2. MacBook Air 13" (M4): the same handoff lines and AOP IS READY, the sound cards register as they do on main, 0 failed units, 0 new kernel errors.

This branch is 127 commits behind main, and main now checks ASC segments against the DART's input range. Update the branch first and run both rows at the new head, so the rows cover that check.

I moved the description into the What / Tested / Risk / Not yet layout and dropped the attribution line. Nothing else in it changed.

Evidence
  • On main, dt_reserve_asc_segments_at() only applies the range check when dt_device_dart_mmio() can match the ADT node's iommu-parent to the FDT iommus DART. The node passed here is /arm-io/aop/iop-aop-nub, so on an ADT where that node has no iommu-parent the check reports "unknown" and changes nothing. Row 1 is what confirms this on real firmware.
  • Which trees take the handoff after this change: t8132-laptop.dtsi (J713, J715, J604) and t8132-jxxx.dtsi through t8132-desktop.dtsi (J773g, J623, J624) all list /arm-io/aop in linux-enablement-mac,dapf-handoff. The J715 and the iMacs take it for the first time. A row from any of them is welcome, but it does not hold the merge. If any step fails on one of those boards, its AOP ends up disabled rather than enabled with no firmware regions, which is no worse than today.

@github-actions github-actions Bot added blast:m4 Macs affected, from Merge risk (bot) door:two-way Revertible or not, from Merge risk (bot) and removed needs-template PR body lacks required sections (bot) labels Nov 24, 2026
@github-actions

github-actions Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Merge readiness at a7a8067a: not ready yet

Check Detail
CI at head ok 15 checks passed
Review no needs one approving review from Core or Omarchy Mac (not the author)
Requested changes no requested by satchlj
Hardware row at head ok comment at a7a8067a
Conflicts ok none
PR text ok Risk: two-way · M4 (T8132): J713, J715, J604, J773g, J623, J624

Areas: none matched in CODEOWNERS

Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels.

@satchlj satchlj left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict at a7a8067a319b

REQUEST CHANGES — The code change and CI are completely clean, with zero code-level blockers. Holding approval solely on the exact-head J713 and J773g hardware verification rows explicitly noted as pending in the PR description.

Blockers

  1. Pending exact-head hardware verification (a7a8067a319b): The PR description marks the J713 and J773g live boot rows as Not yet (Hardware row at head: no), specifically to confirm the post-#377 DART input-range checks on real hardware with the allowlist removed. Please post exact-head J713 and J773g boot transcripts at a7a8067a319b (or re-request review once added).

Checked

  • Changed files (1): Audited the full 48-line diff in src/kboot.c. Removing the apple,j713 / apple,j604 board-compatible allowlist in dt_set_t8132_aop() cleanly delegates eligibility to the runtime gates already in place (/chosen linux-enablement-mac,dapf-handoff, halted AOP state, ADT segments, and DAPF setup), and every failure/refusal path continues to leave AOP disabled.
  • Metadata & CI: 16/16 CI checks passing (SUCCESS); commit carries author Signed-off-by:.
  • Untested scope: No live J713 or J773g bootloader hardware test performed during this review; code audit and CI checks only.
Evidence
  • Head commit: a7a8067a319b (1 file changed: src/kboot.c).
  • CI: 16/16 SUCCESS.
  • Remaining gate: exact-head J713 and J773g hardware boot rows confirming AOP handoff and DART input-range validation.

@github-actions github-actions Bot added the changes-requested A reviewer requested changes (bot) label Nov 24, 2026
@RyanTheTide

Copy link
Copy Markdown
Contributor

@DjDeveloperr this code has been ready since your own 11-24 FINISH. The only things satchlj's change request holds on are the two rows, so let's split them:

  1. J713 (M4 Air): ours. It's queued on the lab J713 as a silent aura-try Stage 2 one-shot of this head on current main. It checks "AOP handed off with its DAPF and firmware segments", DART input range unknown for the AOP with no RAM only line, the 18 memory-region entries, AOP IS READY, both cards registered, speakerguardd v2 --check passing, and 0 failed units.
  2. J773g (M4 mini): yours. You ran secboot: carry an enforcing stage's policy into a Stage 2 without checks #533 on your J773g, so could you run the same one-shot of a7a8067a there with the checks from your 11-24 review?

Once both are posted I'll ask satchlj to re-review and request the App verdict at head.

@RyanTheTide

Copy link
Copy Markdown
Contributor

J713 (M4 Air) row at a7a8067a: PASS. It was a silent one-shot aura-try Stage 2 of this head merged on current main 70f82dc3 (1.0.0b17-g678389e9), on the J713's own tail with the default kernel 7.3.0-aurora-fleet85, compared against the production Stage 2 1.0.0b15-g8a050468 on the same Mac:

  • aura logged FDT: /soc/aop@390600000: AOP handed off with its DAPF and firmware segments and DART input range unknown, 0 bits. There was no past the DART's ... range, RAM only line, and the 16 DAPF slices and 15 windows were reserved.
  • The AOP is okay with 18 memory-region entries, the same as production. Cards AppleJ713HPAI, AppleJack and AppleJ713 registered, and speakerguardd v2 reported protection ready. All of this was silent.
  • Enforcing, 0 failed units, 0 AVC denials, 0 DART faults. The only new kernel error lines are the dcpext PIODMA -ENODEV set, which a main control on this Mac also shows (see kboot_gpu: T6050: hand the G17C (M5 Max) GPU over from the ADT #281's 11-28 J713 control), and one SEP sensor nonce timeout. None of them concern the AOP.
  • The Mac is restored to its configured Stage 2 and verified.

@satchlj, this covers the J713 half of your row blocker. The J773g row is still open with @DjDeveloperr.

@aurora-silicon-review aurora-silicon-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: MERGE at a7a8067 after the J773g peer and human re-review

The handoff is selected by the OS tree request and the ADT resources. The J713 trial exercises the integrated AOP handoff: the production memory-region count is preserved, audio devices and v2 protection register silently, and the configured Stage 2 was restored. This closes the J713 ask. Keep the J773g input-range coverage and existing human change request disposition.

@github-actions github-actions Bot removed the needs-hw-row No hardware row at the PR head (bot) label Nov 29, 2026
@RyanTheTide

Copy link
Copy Markdown
Contributor

Merging under the 6-point rule at a7a8067a.

  1. The review App approved at this head.
  2. Full CI is green at this head, and the branch merges cleanly into current main.
    3/4. Rows: the J713 (M4 Air) row passed at this head on current main (AOP handed off, DART input range unknown, 18 memory-region entries, cards and speakerguardd v2 ready, 0 failed units). The J773g row is not done yet. It is tracked as a known gap in aura: J773g AOP handoff row for #418 (allowlist removal) #572. If the handoff refuses there, the AOP stays disabled as it did before this change.
  3. satchlj's change request held only on the two rows (no code findings). The J713 half was posted and satchlj was pinged at 02:31Z, and there has been no objection since. The J773g half is aura: J773g AOP handoff row for #418 (allowlist removal) #572.
  4. @DjDeveloperr wrote this and gave it FINISH on 11-24.

Thanks @DjDeveloperr. @satchlj, the remaining row is tracked in #572. @DjDeveloperr, if you can run the J773g one-shot on main, post it there.

Revert: git revert -m 1 <merge commit>.

@RyanTheTide
RyanTheTide merged commit 87b7a89 into main Nov 29, 2026
16 of 17 checks passed
@RyanTheTide
RyanTheTide deleted the djdev/t8132-aop-handoff-by-property branch November 29, 2026 04:55
RyanTheTide added a commit to techmore/aura that referenced this pull request Nov 29, 2026
)

src/kboot.c: aurora-silicon#418 dropped the J713/J604 board list from dt_set_t8132_aop() too. Keep this branch's reserve-then-program transaction and main's comment (with __EDATA and the J773g contract), reworded for the new order.

Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

blast:m4 Macs affected, from Merge risk (bot) changes-requested A reviewer requested changes (bot) door:two-way Revertible or not, from Merge risk (bot) needs-review No approving review from Core or Omarchy Mac yet (bot)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants